<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 默认赋值   es6 -->
    <script>
        function go({
            method="get",//赋予默认值的时候要用等于号=
            url
        }){
            console.log(method);
            console.log(url);
        }
        // go({}) //不想传参时候，如果是对象要赋值空对象
        go({ 
            method:"post",
            url:"baidu"
        })
    </script>
</body>
</html>